<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:outputText value="System error: Message model List is null"
		rendered="#{messageModel.list == null}" />
	<h:outputText value="System error: Message model current is null"
		rendered="#{messageModel.current == null}" />
	<p:dataTable id="messageListTable" var="message" value="#{messageModel.list}" filteredValue="#{messageModel.filteredList}" filterEvent="enter"
		rowKey="#{message.id}" selection="#{messageModel.current}"
		selectionMode="single" paginator="true"  rows="10" rowsPerPageTemplate="5,7,10,15,20,30,40,50"
		paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
		<p:ajax event="rowSelect" update=":detailForm,:headerForm"
			listener="#{messageController.onRowSelect}"></p:ajax>
		<p:column headerText="id" sortBy="#{message.id}">
			<h:outputText value="#{message.id}" />
		</p:column>
		<p:column headerText="Title" sortBy="#{message.title}"
			filterBy="#{message.title}" filterMatchMode="contains">
			<h:outputText value="#{message.title}" />
		</p:column>
		<p:column headerText="Published Date" sortBy="#{message.publishedDate}"
			filterBy="#message.publishedDate}" filterMatchMode="contains">
			<h:outputText value="#{message.publishedDate}" />
		</p:column>
	</p:dataTable>
</ui:composition>
</html>